﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using DevExpress.Utils;
using System.Reflection;

namespace DevExpress.MailClient.Win {
    [Flags]
    public enum MailFolder { All = 0, Announcements = 1, ASP = 2, WinForms = 4, IDETools = 8, Frameworks = 16 };
    public enum MailType { Inbox, Deleted, Sent, Draft };
    public enum ContactGender { Male, Female }
    public enum DialogRole { New, Edit }
    public enum TaskStatus { NotStarted, InProgress, Completed, WaitingOnSomeoneElse, Deferred };
    public enum TaskCategory { HouseChores, Shopping, Office };
    public enum FlagStatus { Today, Tomorrow, ThisWeek, NextWeek, NoDate, Custom, Completed };
    public enum ContactTitle { None, Dr, Miss, Mr, Mrs, Ms, Prof };
    public class StringResources { 
        public static string Get(string name) {
            if(LocalizationHelper.IsJapanese) {
                FieldInfo fi = typeof(StringResourcesJa).GetField(name);
                if(fi != null) return string.Format("{0}", fi.GetValue(null));
            }
            return GetDefault(name);
        }
        static string GetDefault(string name) {
            FieldInfo fi = typeof(StringResourcesEn).GetField(name);
            return string.Format("{0}", fi.GetValue(null));
        }
        static string GetMailTypeString(MailType type) {
            switch(type) {
                case MailType.Deleted: return Properties.Resources.DeletedItems;
                case MailType.Draft: return Properties.Resources.Drafts;
                case MailType.Sent: return Properties.Resources.SentItems;
            }
            return Properties.Resources.Inbox;
        }
        public static string GetSearchPrompt(MailType type) {
            return string.Format(Properties.Resources.SearchString, GetMailTypeString(type));
        }
        public static string GetMessagesString(int count) {
            if(count == 1) return Properties.Resources.Message;
            return Properties.Resources.Messages;
        }
    }
    public class StringResourcesEn {
        public const string AboutMessage = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html>\r\n\t<head>\r\n\t\t<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\" /><title>\r\n\t\t</title>\r\n\t\t<style type=\"text/css\">\r\n\t\t\t.cs2654AE3A{text-align:left;text-indent:0pt;margin:0pt 0pt 0pt 0pt}\r\n\t\t\t.csFA2B46FE{color:#A31515;background-color:transparent;font-family:Verdana; font-size:10pt; font-weight:normal; font-style:normal; }\r\n\t\t\t.csDB1295EE{color:#0000FF;background-color:transparent;font-family:Verdana; font-size:10pt; font-weight:normal; font-style:normal; }\r\n\t\t\t.csE64BDD06{color:#A31515;background-color:transparent;font-family:Verdana; font-size:10pt; font-weight:bold; font-style:normal; }\r\n\t\t</style>\r\n\t</head>\r\n\t<body>\r\n\t\t<span><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">Hi Mike,</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">&nbsp;</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">As you no doubt recall, we&#39;ve been working hard on a new mail client for Windows. Well, it&#39;s time to announce that we&#39;ve finally completed it. I&#39;ve uploaded the release candidate of Campagne Client to our server: </span><span class=\"csDB1295EE\">\\\\dx-server1\\uploads\\MailClient\\</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">&nbsp;</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">I&#39;d be grateful if you would take some time to go over it and frmEditCompagne it. Please make sure it meets your needs.</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">&nbsp;</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">Our initial estimate for the time to completion turned out to be way off. Thanks to DevExpress&#39; WinForms components we managed to finish the project </span><span class=\"csE64BDD06\">three times faster</span><span class=\"csFA2B46FE\"> than we&#39;d originally planned. Their support service is very responsive and helped us no end.</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">&nbsp;</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">Here are some screenshots of the new Campagne Client:</span></p><p class=\"cs2654AE3A\"><div style=\"width:277.5pt;height:159.75pt;\">\r\n\t\t\t<span><img src=\"\" width=\"370\" height=\"213\" alt=\"\" style=\"border-width:0px;\" /></span></div>\r\n\t\t</p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">Thanks,</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">&nbsp;</span></p><p class=\"cs2654AE3A\"><span class=\"csFA2B46FE\">Steve Broad</span></p></span></body>\r\n</html>\r\n";
        public const string MessageTile = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html><body><style type=\"text/css\">.style1{font-size: x-small;font-family: \"Segoe UI\";}.style2{font-family: \"Segoe UI\";color: #666666;}.style3{font-family: \"Segoe UI\";}</style>";
        public const string MessageTileEx = "<span class=\"style3\">{0} (</span><span class=\"style1\">{1}</span><span class=\"style3\">)</span><span class=\"style2\"><br />{2}<br /><br /></span>";
        public const string MessageTileEnd = "</body></html>";
        public const string AboutMessagePlain = "Well, it's time to announce that we've finally completed it.";
    }
    public class TagResources
    {
        public const string Optimization = "Optimization";
        public const string OptimizationTv = "Optimization Tv";
        public const string OptimizationRd = "Optimization Radio";
        public const string OptimizationPr = "Optimization Presse";


        public const string ProcessPlan = "Calduler indicateur";
        public const string SavePlan = "Sauvegarder les plan media";
        public const string NewPlan = "Nouveau Plan Media";
        public const string RotateLayout = "RotateLayout";
        public const string FlipLayout = "FlipLayout";
        public const string DeleteItem = "DeleteItem";
        public const string NewCampaign = "NewCampaign";
        public const string Reply = "Reply";
        public const string ReplyAll = "ReplyAll";
        public const string Forward = "Forward";
        public const string UnreadRead = "Unread/Read";
        public const string SearchTools = "Search Tools";
        public const string CloseSearch = "CloseSearch";
        public const string ClearFilter = "ClearFilter";
        public const string SubjectColumn = "Subject";
        public const string PersonColumn = "Person";
        public const string DateColumn = "Date";
        public const string PriorityColumn = "Priority";
        public const string AttachmentColumn = "Attachment";
        public const string ResetColumnsToDefault = "ResetColumns";
        public const string DateFilterMenu = "DateFilterMenu";
        public const string ContactList = "List";
        public const string ContactAlphabetical = "Alphabetical";
        public const string ContactByState = "ByState";
        public const string ContactCard = "Card";
        public const string OpenCalendar = "OpenCalendar";
        public const string MenuSaveAs = "SaveAs";
        public const string MenuSaveAttachment = "SaveAttachment";
        public const string MenuSaveCalendar = "SaveCalendar";
        public const string FeedNew = "NewFeed";
        public const string FeedEdit = "EditFeed";
        public const string FeedDelete = "DeleteFeed";
        public const string FeedRefresh = "RefreshFeed";
        public const string TaskList = "TaskList";
        public const string TaskToDoList = "TaskToDoList";
        public const string TaskPrioritized = "TaskPrioritized";
        public const string TaskCompleted = "TaskCompleted";
        public const string TaskToday = "TaskToday";
        public const string TaskOverdue = "TaskOverdue";
        public const string TaskSimpleList = "TaskSimpleList";
        public const string TaskDeferred = "TaskDeferred";
        public const string ContactNew = "NewContact";
        public const string ContactEdit = "EditContact";
        public const string ContactDelete = "DeleteContact";
        public const string TaskNew = "NewTask";
        public const string TaskEdit = "EditTask";
        public const string TaskDelete = "DeleteTask";
        public const string Preview = "ShowPreview";
        public const string NewCible = "NewCible";
        public const string ChargerDonnees = "ChargerDonnees";
    }
    public class CollectionResources {
        public static List<string> HouseTasks = new List<string>() {"Set-up my home theater (surround sound) system", "Light Install", "Install three lamps", "Install a programmable thermostat", "Install ceiling fan",
            "LED strip lighting installation", "Control Panel Maintenance", "Install dimmer on light switch", "Install an outlet and hang light", "Install electrical outlet and ethernet in closet",
            "Installation of a chandelier", "Hook up DVD Player to TV", "Apartment cleaning", "Tidy Up My House", "Whole House Cleaning", "Clean and organize basement", "Pick up clothes for charity",
            "Ironing, laundry and vacuuming", "Play with kittens on Sunday", "Clean art studio", "Bake brownies and mail them to Alice", "Assemble Kitchen Cart", "Move piano", "Clean backyard", "Clean out garage",
            "Organize guest bedroom", "Clean out closet", "Preparing for yard sale", "Sorting clothing for give-away", "Organize Storage Room"};
        public static List<string> ShoppingTasks = new List<string>() {"Shopping at Macy's", "Return teapot", "Purchase plastic bins", "Shopping for dinner ingredients", "Buy wooden blinds", "Send post card to Timothy", 
            "Buy dining table and TV stand online", "Buy ingredients for Pasta Bolognese", "Size 3 diapers (3 cases)", "Order 3 pizzas", "Find out where to buy an iPad in store", "Buy brussel sprouts and tomatos", 
            "Buy bottle of Champagne", "Grocery shopping at Market Basket", "Find a bike at a store close to me", "Return jeans at jcrew", "Shopping - Dog treats", "Buy rigid foam insulation", 
            "Purchase 3 24-packs of bottled Mexican Coke", "Purchase & deliver flowers to my home"};
        public static List<string> OfficeTasks = new List<string>() {"Input bank statement transactions in to Excel spreadsheet", "Schedule appointments and pay bills", "Place new address stickers on envelops", 
            "Set up and arrange appointments", "Copy PDF file into Word", "Organize business expenses (last 6 months)", "Return samples to vendor", "Organise receipts and match them up with business expenses and trips ", 
            "File papers", "Ship out CDs to customers", "Respond to e-mails untill noon", "Enter expenses into an online accounting system", "Do inventory of all furniture in office", "Travel arrangement", 
            "Staple flyers to gift bags", "File and shred mail", "Print copies of brochure", "Enter all receipts into an excel sheet", "Research possible vendors", "Sort through paper receipts", 
            "Re-package products for retail sale", "Scan docs, and put in desktop folder", "Print registration stickers"};
    }
    public class FontResources {
        public static Font StrikeoutFont = new Font(AppearanceObject.DefaultFont, FontStyle.Strikeout);
        public static Font BoldFont = new Font(AppearanceObject.DefaultFont, FontStyle.Bold);
    }
    public delegate void DataSourceChangedEventHandler(object sender, DataSourceChangedEventArgs e);
    public class DataSourceChangedEventArgs : EventArgs {
        List<Message> list;
        MailType type;
        string caption;
        public DataSourceChangedEventArgs(object caption, object list, object type) {
            this.list = (List<Message>)list;
            this.type = (MailType)type;
            this.caption = string.Format("{0}", caption);
        }
        public List<Message> List { get { return list; } }
        public MailType Type { get { return type; } }
        public string Caption { get { return caption; } }
    }
}
